﻿using AntUnion.FrameWork.Model.Models;
using AntUnion.FrameWork.Web.Quarzs;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace AntUnion.FrameWork.Web.Extend.Quarzs
{
    public static class ServiceCollectionExtensions
    {
        public static void AddJob(this IServiceCollection services)
        {
            using (mtContext _context = new mtContext())
            {
                //string each = _context.TbSystemConfigs.Where(k => k.MenuName == "each").Select(k => k.Value).FirstOrDefault();
                //string each_config = $"0 0 */{each} * * ?";
                //services.AddSingleton(new JobSchedule(jobType: typeof(PublishJob), cronExpression: each_config));
            }
        }
    }
}
